<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{{config('admin.title')}} | {{ trans('admin::lang.login') }}</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.5 -->
  <link rel="stylesheet" href="{{ cdn("/packages/admin/AdminLTE/bootstrap/css/bootstrap.min.css") }}">
  <!-- Font Awesome -->
  <!-- Theme style -->
  <link rel="stylesheet" href="{{ cdn("/packages/admin/AdminLTE/dist/css/AdminLTE.min.css") }}">
  <style>
    .hospital-name{
      width: 65%;
      margin: 0 auto;
    }
    .system-name{
      width: 100%;
      font-size: 18px;
      margin: 20px auto 0 auto ;
      font-family: "SimHei","Microsoft YaHei","微软雅黑", "宋体", Arial, sans-serif;
      color: #3a6496;
    }
    .login-box-body{
      margin: 0 auto;
      width: 75%;
      border-radius: 12px;
    }
    .password-name{
      width: 25%;
      float: left;
      line-height: 34px;
      font-size: 16px;
    }
    .form-control{
      width: 75%;
      float: left;
      padding: 6px!important;
      border: none;
      background: #fff!important;
      border-bottom: solid 1px #ccc;
    }
    .form-group{
      float: left;
      width: 100%;
      margin-top: 15px;
    }
    .btn-primary{
      background-color: #3a6496;
      border-radius: 5px!important;
      border-color:#3a6496!important;
      font-size: 18px;
      margin-top: 15px;
      padding:10px 12px;
    }
    .btn-primary:hover{
      background-color:#1d4d85 ;
    }
    .btn-primary:active{
      background-color:#1d4d85 ;
    }
    .btn-primary.focus, .btn-primary:focus,.btn-primary:active:focus{
      background-color: #1d4d85;
    }
    .login-box{
      width: 500px;
    }
    input:-webkit-autofill{
      -webkit-box-shadow:0 0 0 114px #fff inset;
    }
    input:-webkit-autofill:hover {
      background-color: #fff;
    }
    input:-webkit-autofill:focus {
      background-color: #fff;
    }
    .r{
      width: 15px;
      height: 15px;
      line-height:15px;
      float:left;
      border-radius: 50%;
      border: solid 1px #fff;
      margin-left: 5px;
      font-size: 13px;
    }
    .text{
      line-height: 15px;
      margin: 20px auto 0 auto;
      font-size: 13px;
      color: #333;
    }

    .url-input{
      width: 42.5%;color: #333;
    }
    label{
      display: block;
    }
    .url-wingedcare{
      height: 35px;
      line-height: 35px;
      font-size: 14px;
      color: #333;
    }
    @media only screen and (max-width: 720px){
      .password-name{
        width: 28%;
      }
      .form-control{
        width: 68%;
      }
      .url-input{
        width: 30%!important;
      }
      .login-box{
        width: 95%!important;
      }
      .login-box-body{
        width: 95%!important;
      }
      .system-name{
        margin: 10px auto 0 auto!important;
      }
    }
    @media only screen and (max-width: 800px){
      .url-input{
        width: 37%;
      }
      .login-box{
        width: 90%;
      }
      .login-box-body{
        width: 90%;
      }
    }

    @media only screen and (min-width: 850px){
      .login-box{
        margin: 21vh auto auto auto;
      }
      .login-box-b{
        margin: 27.5vh auto auto auto;
      }
    }
    @media only screen and (min-width: 1900px){
      .login-box{
        margin: 22.5vh auto auto auto;
      }
      .login-box-b{
        margin: 29vh auto auto auto;
      }
    }
    @media only screen and (max-height: 769px){
      .login-box{
        margin: 9vh auto auto auto;
      }
      .login-box-b{
        margin: 17vh auto auto auto;
      }
    }
    .two-code{
        margin-top:20px;
        width:80%;
        margin-left:10%;
    }
    .ios-code{
      width:50%;
      display:inline-block;
      float:left;
      align:center;
      color:#fff
    }
    ..ios-code div{
      color:#fff
    }
    .two-code img{
      display:flex
    }
    #lyj{
      display:none;
      float:right;
      text-align:left;
      width:75%
    }
  </style>
  @if (!is_null(app()->tenant->getStyle()))
  <link rel="stylesheet" href="{{ app()->tenant->getStyle() }}">
  @endif
  <!-- iCheck -->
  <![endif]-->

</head>
<body class="hold-transition" style="height:100%;background: url({{app()->tenant->getBackground()}}) center;background-size:cover;-moz-background-size:cover;
    -webkit-background-size:cover;
    text-align: center;">
<div id="box" class="login-box">
  <div class="login-logo">
    <a href="{{ Admin::url('/') }}"><img class="hospital-name" src="{{ app()->tenant->getLogoLarge() }}"></a>
    <div class="system-name">{{ app()->tenant->getMainTitle() }}</div>
  </div>
  <!-- /.login-logo -->
  <div class="login-box-body">
    {{--<p class="login-box-msg">{{ trans('admin::lang.login') }}</p>--}}
    <form action="{{ Admin::url('auth/login') }}" method="post" onsubmit="return check(this)">
      @include('winged::widgets.error-label', ['errors' => $errors, 'key' => 'login'])
      @if(is_null($uuid))
        <div id="url_error" class="form-group has-feedback {!! !$errors->has('domain') ?: 'has-error' !!}">
          @include('winged::widgets.error-label', ['errors' => $errors, 'key' => 'domain'])
          <div class="password-name">专属域名:</div>
          <input onkeyup="Search()" type="input" class="form-control url-input" placeholder="" name="domain" value="{{ old('domain') }}">
          <span class="url-wingedcare">.wingedcare.com</span>
          <a href="http://reception-console.winged-tech.com" id="lyj">前往梁益建工作室后台</a>
        </div>
      @endif

      <div class="form-group has-feedback {!! !$errors->has('username') ?: 'has-error' !!}">
        @include('winged::widgets.error-label', ['errors' => $errors, 'key' => 'name'])
        <div class="password-name">用户名:</div>
        <input type="input" class="form-control" placeholder="" name="name" value="{{ old('name') }}">
      </div>
      <div class="form-group has-feedback {!! !$errors->has('password') ?: 'has-error' !!}">
        @include('winged::widgets.error-label', ['errors' => $errors, 'key' => 'password'])
        <div class="password-name">密码:</div>
        <input type="password" class="form-control" placeholder="" name="password" value="{{ old('username') }}">
      </div>
      <div class="row">

        <!-- /.col -->
        <div class="col-xs-12">
          <input type="hidden" name="_token" value="{{ csrf_token() }}">
          <button type="submit"  class="btn btn-primary btn-block btn-flat">登录</button>
        </div>
        <!-- /.col -->
      </div>
        <div class="text"><span style="">Copyright © 2017 Winged-Tech. All Rights Reserved</span></div>
    </form>

  </div>
  <!-- /.login-box-body -->
  @if(!is_null(app()->tenant->getBarcodes()))
    <div class="two-code">
      <div class="ios-code" align="center">
        <img src="{{app()->tenant->getBarcodes()[0]}}" /> 
        <div>iOS版</div>
      </div>
      <div class="ios-code"  align="center">
        <img src="{{app()->tenant->getBarcodes()[1]}}" /> 
        <div>android版</div>
      </div>
    </div>
  @endif
</div>
<!-- /.login-box -->

<!-- jQuery 2.1.4 -->
<script src="{{ cdn("/packages/admin/AdminLTE/plugins/jQuery/jQuery-2.1.4.min.js")}} "></script>
<!-- Bootstrap 3.3.5 -->
<script src="{{ cdn("/packages/admin/AdminLTE/bootstrap/js/bootstrap.min.js")}}"></script>
<!-- iCheck -->
<script src="{{ cdn("/packages/admin/AdminLTE/plugins/iCheck/icheck.min.js")}}"></script>
<script>
  $(function () {
    $('input').iCheck({
      checkboxClass: 'icheckbox_square-blue',
      radioClass: 'iradio_square-blue',
      increaseArea: '20%' // optional

    });
  });
  if ($('.url-input').length==0){
      $('#box').addClass('login-box-b');
  }
  function Search(){
    if($(".url-input").val().indexOf('cd3')>-1){
      $('#lyj').show();
    }else{
      $('#lyj').hide();
    }
    console.log($(".url-input").val())
  }
  function check(form) {
      if ($('.url-input').length!=0){
		  if (form.domain.value == ''){
			  show_error('error-domain','请输入域名');
			  return false
		  }else {
			  show_error('error-domain',null);
          }
      }
	  if (form.name.value == ''){
		  show_error('error-name','请输入用户名');
		  return false
	  }else {
		  show_error('error-name',null);
      }
	  if (form.password.value == ''){
		  show_error('error-password','请输入密码');
		  return false
	  }else {
		  show_error('error-name',null);
      }
	  return true
  }
  function show_error(id, message) {
  	var el = $('#' + id);
  	if (message != null) {
  		el.text(message);
  		el.show();
    }
    else {
  		el.hide();
    }
  }

</script>
</body>
</html>

